package com.niiwoo.activity.stage.enums.mall;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 商城商品过滤条件
 * @author zjb
 *
 */
@Getter
@AllArgsConstructor
public enum MallGoodsFiltrateEnum {

	ORDER_FILTRATE_DEFAULT((byte)0,30, "智能排序"),
	ORDER_FILTRATE_S_H_L((byte)1,30, "积分高到低"),
	ORDER_FILTRATE_S_L_H((byte)2,30, "积分低到高"),
	ORDER_FILTRATE_HOT((byte)3,30, "人气最高"),
	
	OBTAINABLE_FILTRATE_ALL((byte)0,40, "全部可兑换的"),
	OBTAINABLE_FILTRATE((byte)1,40,"我可兑换的");

	
    private Byte code;
    private Integer type;
    private String desc;
    
    @Getter
	@AllArgsConstructor
	public enum UseFiltrateEnum{
    	USE_FILTRATE_OTHER((byte)0,10, "其他(用途)"),
    	USE_FILTRATE_INVEST((byte)1,10, "投资(用途)"),
    	USE_FILTRATE_BORROW((byte)2,10, "借款(用途)"),
    	USE_FILTRATE_ALL((byte)3,10, "全部(用途)");
//		
		private Byte code;
	    private Integer type;
	    private String desc;
	    
	    /**
         * 通过typeId来获取分类，若找不到则归为其他分类
         * @param goodsTypeId
         * @return
         */
        public final static UseFiltrateEnum getFiltrate(Byte code){
        	for(UseFiltrateEnum tfEnum :values()){
        		if(tfEnum.getCode().equals(code)){
        			return tfEnum;
        		}
        	}
        	return null;
        }
    }
    
    @Getter
	@AllArgsConstructor
	public enum TypeFiltrateEnum{
    	TYPE_FILTRATE_ALL((byte)4,20, "全部(分类)","all"),
		TYPE_FILTRATE_REDMONEY((byte)1,20, "红包(分类)","redmoney"),
		TYPE_FILTRATE_REALITY((byte)2,20, "实物(分类)","reality"),
		TYPE_FILTRATE_CARD((byte)3,20, "卡券(分类)","card"),
		TYPE_FILTRATE_OTHER((byte)0,20, "其他(分类)","other");
		
		private Byte code;
	    private Integer type;
	    private String desc;
	    private String key;
	}
}
